package com.example.spider.provider.why10w.deprecated.wgwhy10;

import com.example.spider.provider.why10w.deprecated.wgwhy10.task.Wgwhy10ListTask;

/**
 * 爬虫任务创建器
 *
 * @author lym
 */
public class Wgwhy10ListTaskFactory {

    public static Wgwhy10ListTask createPageTask(String category, int pageNo) {
        String baseUrl = "https://www.10wgwhy.com/" + category + "/";
        return new Wgwhy10ListTask()
                .setCategory(category)
                .setPage(pageNo)
                .setUrl(pageNo == 1 ? baseUrl : baseUrl + pageNo);
    }

}
